Project 5: Robot Algorithm

CS 110 • 20 Points Total
Due on-line Wed. Apr. 25, 2018

Objectives


Download and unzip this scenario:

The following section describes what you need to do with the scenario. Have a Java book handy - the types of commands and variable definitions you'll need to program use the same ideas as Alice but they have a slightly different syntax!


RoboMaze

Recall our discussion on Algorithmic Thinking with robots in the first weeks of the semester. Start Greenfoot and Open the RoboMaze scenario. If you get a message that says the program was written with an older version of Greenfoot, enter "continue". If any of the classes have grey stripes, you need to press the "compile all" button. Then, try putting MazeBot objects into the maze. Right-click them and pick "Inherited from GenericRobot..." to try calling different methods on them - moveForward(), turnRight(), turnLeft(), and obstacleInFront() are the ones you'll be needing to use. Note that the robot leaves a footprint behind it each time it moves so you can tell where it's been.

Double-click the "MazeBot" class to edit it. You'll see the act() method - you must fill it out so the robot takes one step forward in the proper direction each time act() is called. Have the robot take a right-hand opening when possible - failing that, it should then try going forward, left, and back - in that order. Here's an act() method that would move the robot forward each time it was called, for reference:

    public void act()
    {
      moveForward();
    }

Click "compile" each time you make changes, then put another MazeBot in the maze and click play. Once your code is correct the robot should visit every location in the maze on its own.

When you have it working, take a screenshot (Windows: [Alt-Print Screen] and then paste) and print out the source code for MazeBot.


Electronic Submission

Once you've finished your project, zip your Robomaze solution folder. Submit the resulting zipped folder through the Blackboard Learn Course Page by the due date.

How to create zipped folder:
For Windows users: 1) right-mouse-button click on the file/folder, 2) SEND TO compressed (zipped) folder.
For Mac users: 1) Find the file or folder you want to compress, 2) Control + Click on the file/folder, 3) click on 'Compress Items', 4) this should create a new .zip file.

Project Report

Create a project report with a project overview, screen shots, the source code for the robot, and the following cover page. Adjust the date to be the day you actually turn in the project:

Project 5: Robot Algorithm

Your Name
date handed in

CS 110

For the project overview, describe your overall strategy on solving the RoboMaze scenario.

Upload into Blackboard Learn by the due date. Remember the filenaming convention of Lastname_Firstname_Proj5.docx or something similar.